Hệ thống quản lý ISP trong PHP

1 +<?php include 'includes/header.php'; ?>
2 <?php
3     require_once
"includes/classes/admin-class.php";
4     $admins =
new Admins($dbh);
5 ?>
6 <div
class="dashboard">
7     <div
class="col-md-12 col-sm-12">
8     <h2
class="col-md-3">Products Stock</h2>
9     <br><br>
10     <div
class="col-md-3 pull-right">
11         <form
class="form-inline pull-right">
12           <div
class="form-group">
13             <label
class="sr-only" for="search">Search for</label>
14             <div
class="input-group">
15               <div
class="input-group-addon"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></div>
16               <input type=
"text" class="form-control" id="search" placeholder="Type a name">
17               <div
class="input-group-addon"></div>
18             </div>
19           </div>
20         <!-- <button type=
"submit" class="btn btn-info">Search</button> -->
21         </form>
22     </div>
23     <hr>
24     <div
class="col-md-12 col-sm-12">
25         <table
class="table center table-striped table-bordered" id="grid-basic">
26             <thead
class="thead-inverse">
27               <tr
class="info">
28                 <th>Product ID</th>
29                 <th>Product Name</th>
30                 <th>Category</th>
31                 <th>Details</th>
32                 <th>Quantity</th>
33                 <th>Action</th>
34               </tr>
35             </thead>
36           <tbody>
37             <?php
38             $products = $admins->fetchProductionStats();
39             
if (isset($products) && sizeof($products) > 0){
40             
foreach ($products as $product) {
41                 $proID = $product->product_id;
42                 $proName = $admins->getAProduct($proID);
43                 $product_name = $proName->pro_name;
44                 $product_details = $proName->pro_details;
45                 $product_category = $proName->pro_category;
46             ?>
47             <tr>
48                 <td><?=$product->product_id?></td>
49                 <td
class="search"><?php echo $product_name; ?></td>
50                 <td
class="search"><?php echo $product_category; ?></td>
51                 <td><?php echo $product_details; ?></td>
52                 <td><?=$product->quantity?></td>
53                 <td><button type=
"submit" class="btn btn-info">LEDGER</button></td>
54             </tr>
55           <?php }} ?>
56           </tbody>
57         </table>
58     </div>
59 </div>
60 <?php include
'includes/footer.php'; ?>
61 <script type=
"text/javascript">
62     document.getElementById(
'date').valueAsDate = new Date();
63 </script>
64     <script type=
"text/javascript">
65       $(function() {
66         grid = $(
'#grid-basic');
67
68         
// handle search fields of members key up event
69         $(
'#search').keyup(function(e) {
70           text = $(
this).val(); // grab search term
71
72           
if(text.length > 1) {
73             grid.find(
'tr:has(td)').hide(); // hide data rows, leave header row showing
74
75             
// iterate through all grid rows
76             grid.find(
'tr').each(function(i) {
77               
// check to see if search term matches Name column
78               
if($(this).find('.search').text().toUpperCase().match(text.toUpperCase()))
79                 $(
this).show(); // show matching row
80             });
81           }
82           
else
83             grid.find(
'tr').show(); // if no matching name is found, show all rows
84         });
85         
86       });
87     </script>


Gõ tìm kiếm nhanh...